<script>
<!--
var sort_by = '';
var sort_order = 0;
var current_view = '';
var page = 1;

function listReload(page)
{
    $('#indexAjax').html('<div align="center"><div class="loader_admin"></div></div>');
    $('#indexAjax').load('<?php echo url_for('@document_category_edit?document_category_id='.$document_category->document_category_id) ?>&'+$('#filterSearch').serialize(), {
        sort_by:      sort_by,
        sort_order:   sort_order,
        page:         page,
        view:         current_view,
    });
}

-->
</script>
<div class="row-fluid">
    <div class="span12">
        <div class="box">
            <div class="title">
                <h4>
                    <span class="icon16 brocco-icon-grid"></span>
                    <span>Danh mục tài liệu</span>
                </h4>
            </div>
            <div id="EditDocumentCategoryForm" class='content'>
  				<form class="form-horizontal" id="form-document-category-validate" action="<?php echo url_for('@document_category_edit?document_category_id='.((isset($document_category))?($document_category->document_category_id):"").''); ?>" method="post">
                	<div class="form-row row-fluid">
                        <div class="span8">
                            <div class="row-fluid">
                                <?php echo $document_category_form['document_category_id']->renderLabel(null, array("class"=>"form-label span3"));  ?>
                                <div class="span8 controls">
                                    <?php echo $document_category_form['document_category_id']->render(array("class" => "nostyle", "style" => "width:100%", "id" => "cms_category_parent"));  ?>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="form-row row-fluid">
                        <div class="span8">
                            <div class="row-fluid">
                                <?php echo $document_category_form['name']->renderLabel(null, array("class"=>"form-label span3"));  ?>
                                <div class="span8 controls">
                                	<?php echo $document_category_form['name']->render(array("id" => "cms_category_name"));  ?>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="form-row row-fluid">
                        <div class="span8">
                            <div class="row-fluid">
                                <?php echo $document_category_form['position']->renderLabel(null, array("class"=>"form-label span3"));  ?>
                                <div class="span8 controls">
                                	<?php echo $document_category_form['position']->render(array("id" => "cms_category_position"));  ?>
                                </div>
                            </div>
                        </div>
                    </div>
			      	<?php echo $document_category_form['_csrf_token'];  ?>
                    <div class="form-row row-fluid">                              
                        <div class="span12">
                            <div class="row-fluid">
                                <div class="form-actions">
                                <div class="span3"></div>
                                <div class="span9 controls">
                                    <button type="submit" class="btn marginR10">Lưu thay đổi</button>
                                    <button class="btn btn-danger">Làm lại</button>
                                </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <?php if (isset($status) && $status == false): ?>
                    <div class="form-row row-fluid">                              
                        <div class="span12">
                            <div class="row-fluid">
                                <div class="alert alert-error">Danh mục đã tồn tại</div>
                                <script>
                                    window.location.href = document.location.href;
                                </script>
                            </div>
                        </div>
                    </div>
                    <?php endif ?>
  				</form>
			</div>
		</div>
	</div>
</div>
<div style='padding-top:10px;'>
<div class="UITable">
  <div id="indexAjax" class='filter_form'>
    <?php include 'categoryListAjax.php' ?>
  </div>
</div>
</div>